var http = require('http')
var fs = require('fs')
var template = require('art-template')

http.createServer(function (req,res) {
    var url = req.url
    if(url === '/'){
        fs.readFile('./main.html',function (err,data) {
            if(err){
                console.log('找不到问价n')
            }

            var str = template.render(data.toString(),{
                data:'这是一个数据'
            })
            res.end(str)
        })
    }
}).listen(3000,function () {
    console.log('Server is Running')
})